package com.kantboot.user.admin.repository;

import com.kantboot.user.admin.domain.entity.UserAdminRouter;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface UserAdminRouterRepository extends JpaRepository<UserAdminRouter,Long> {

    @Query("""
        FROM UserAdminRouter router
        WHERE router.parentId IS NULL
        ORDER BY router.priority DESC
        """)
    List<UserAdminRouter> findAll();

}
